<template>
	<view class="navWrap">
		<view class="nav-list">
			<view v-for="(item, index) in navList" :key="index" class="nav-item" @click="clickItem">
				<view :style="{background: item.bgColor}" class="icon-box">
					<uni-icons :type="item.icon" size="24" color="#fff"></uni-icons>
				</view>
				<text>安全培训</text>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';

	const navList = ref([{
			bgColor: '#FC7B16',
			icon: 'gift',
			title: ''
		},
		{
			bgColor: '#E35F43',
			icon: 'gift'
		},
		{
			bgColor: '#5665E1',
			icon: 'gift'
		},
		{
			bgColor: '#36CBAC',
			icon: 'gift'
		},
		{
			bgColor: '#E34B83',
			icon: 'gift'
		},
		{
			bgColor: '#FC7B16',
			icon: 'gift'
		},
		{
			bgColor: '#FC7B16',
			icon: 'gift'
		},
		{
			bgColor: '#FC7B16',
			icon: 'gift'
		},
		{
			bgColor: '#FC7B16',
			icon: 'gift'
		},
		{
			bgColor: '#FC7B16',
			icon: 'gift'
		},

	])

	const clickItem = (item) => {
		uni.showToast({
			title: '暂未开放',
			icon: 'none'
		});
	}
</script>

<style lang="scss" scoped>
	.navWrap {
		margin-top: 12px;
		background-color: #fff;
		padding-top: 10px;

		.nav-list {
			width: 100%;
			display: flex;
			flex-wrap: wrap;

			.nav-item {
				width: 20%;
				height: 60px;
				display: flex;
				flex-direction: column;
				align-items: center;
				color: #797979;
				font-size: 24rpx;
				margin-bottom: 10px;

				.icon-box {
					width: 80rpx;
					height: 80rpx;
					border-radius: 50%;
					display: flex;
					align-items: center;
					justify-content: center;
					margin-bottom: 6px;
				}

			}
		}
	}
</style>